function applicat() {
    let name = document.querySelector("#inp1").value
    let rid = document.querySelector("#sele1")
    let index = rid.selectedIndex
    let text = rid.options[index].text
    let room = document.querySelector("#sele2")
    let index1 = room.selectedIndex
    let text1 = room.options[index1].text
    let bed = document.querySelector("#sele3")
    let index2 = bed.selectedIndex
    let text2 = bed.options[index2].text
    let major = document.querySelector("#sele4")
    let index3 = major.selectedIndex
    let text3 = major.options[index3].text
    let clazz = document.querySelector("#sele5")
    let index4 = clazz.selectedIndex
    let text4 = clazz.options[index4].text
    let sex = document.querySelectorAll(".ssex")
    let studentnum = document.querySelector("#inp2").value
    let phone = document.querySelector("#inp3").value
    let telphone = document.querySelector("#inp5").value
    let gender;
    for (let i = 0; i < sex.length; i++) {
        if (sex[i].checked) {
            gender = sex[i].value
        }
    }
    if (!(name && rid.value && room.value && bed.value && major.value && clazz.value && studentnum && phone && telphone)) {
        return alert("请输入完整的信息")
    }
    if (!(/^\d{12,12}$/.test(studentnum))) {
        return alert("学号为12位数")
    }
    if (!(/^\d{11,11}$/.test(phone))) {
        return alert("电话号码为11位数")
    }
    if (!(/^\d{11,11}$/.test(telphone))) {
        return alert("家庭电话为11位数")
    }
    Ajax({
        type: "POST",
        url: "http://localhost/Dorm%20Management/server/applicat.php",
        data: { name, text, text1, text2, text3, text4, gender, studentnum, phone, telphone },
        success() {
            alert("提交成功");
            location.href = "http://localhost/Dorm%20Management/html/login.html";
        }
    })
}